
<html> 
    <head>
        <link href="style3.css" rel="stylesheet" type="text/css" />
        
            
        </form>
    </head> 
</html>
<?php


//open the connection in the DB
$conn = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("mydb", $conn) or die(mysql_error());

if(isset($_GET['submit']))
{
    $query = mysql_query ("SELECT * FROM conference ORDER BY long_name") or die('here' . mysql_error());
    // Query to sort the conferences alphabatically by name.
    //table containing all the conferences available
echo '<table width="100%">
    <tr>
    <td><b>Conference</b>
    </td>
    </tr>';

//redirect to the conference page 
while ($row = mysql_fetch_assoc($query)) {
    echo "<tr>
	  <td>{$row['long_name']}</td> 
	  <td><a href='conferencePage.php?conference_id={$row['conference_id']}'>go to Conference</a </td> 
	  </tr>";
}

echo '</table>';
}
else if(isset($_GET['submit2']))
{
    $date = mysql_query("SELECT * FROM conference ORDER BY rev_startDate")or die('here' . mysql_error());
    //Query to sort the conferences by the date.
        //table containing all the conferences available
echo '<table width="100%">
    <tr>
    <td><b>Conference</b>
    </td>
    </tr>';

//redirect to the conference page 
while ($row = mysql_fetch_assoc($date)) {
    echo "<tr>
	  <td>{$row['long_name']}</td> 
	  <td><a href='conferencePage.php?conference_id={$row['conference_id']}'>go to Conference</a </td> 
	  </tr>";
}

echo '</table>';
}





?>
        

            </body>
</html>

